/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.qframe.client.quicklet.beans;

/**
 * Slot is the bean for of the <slot/> tag.
 * Every Slot instance represent a slot in the UI currently rendered or unrendered.
 *
 * @author gprasad
 */
public class Slot {

    private String slotId;
    private Quicklet defaultQuicklet;

    /**
     * Creates a slot object.
     *
     * @param String slotId
     * @param Quicklet defaultQuicklet
     */
    public Slot(String slotId, Quicklet defaultQuicklet) {
        this.slotId = slotId;
        this.defaultQuicklet = defaultQuicklet;
    }

    /**
     * Returns the default quickletId defined in <slot/> tag
     * @return Quicklet
     */
    public Quicklet getDefaultQuicklet() {
        return defaultQuicklet;
    }

    /**
     * Returns the Slot id as defined in the <slot id='xx'/> tag. Note that
     * there can be mutliple instnace with same id as the quicklet containing
     * this slot can be rendered in multiple places.
     *
     * @return String
     */
    public String getSlotId() {
        return slotId;
    }

    @Override
    public String toString() {
        return "Slot:" + slotId;
    }
}
